//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#include "VmDirectMapControlBlock.h"

#include <sstream>

using namespace std;

/*!
  \file VmDirectMapControlBlock.cc
  \brief Code to configure direct mapping control blocks.
*/

namespace Green {

  VmDirectMapControlBlock::VmDirectMapControlBlock(EPrivilegeLevelType elType, EMemBankType memType)
    : VmControlBlock(elType, memType)
  {
  }

  bool VmDirectMapControlBlock::Validate(std::string& rErrMsg) const
  {
    bool valid_context = true;
    rErrMsg += string("{") + Type() + string("::Validate} Validation mismatches:");
    valid_context &= VmControlBlock::Validate(rErrMsg);

    return valid_context;
  }

  const string VmDirectMapControlBlock::AdditionalAttributesString() const
  {
    stringstream out_str;
    out_str << " : Max-PA=0x" << hex << mMaxPhysicalAddress;
    return out_str.str();
  }

}
